<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
<head>
    <th:block th:include="include :: header('新增客户主数据')"/>
</head>
<body class="white-bg">
<div class="main-content">
    <form class="form-horizontal m" id="form-customer-add">
        <div class="row">
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-3 control-label is-required">客户编码：</label>
                    <div class="col-sm-8">
                        <input class="form-control" type="text" name="code" id="code" required>
                    </div>
                </div>
            </div>
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-3 control-label is-required">客户名称：</label>
                    <div class="col-sm-8">
                        <input class="form-control" type="text" name="name" id="name" required>
                    </div>
                </div>
            </div>
        </div>
        <div class="row">
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-3 control-label">地址：</label>
                    <div class="col-sm-8">
                        <input class="form-control" type="text" name="address" id="address">
                    </div>
                </div>
            </div>
            <div class="col-sm-6">

                <div class="form-group">
                    <label class="col-sm-3 control-label">联系邮箱：</label>
                    <div class="col-sm-8">
                        <input class="form-control" type="text" name="email" id="email">
                    </div>
                </div>
            </div>
        </div>
        <div class="row">
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-3 control-label">传真：</label>
                    <div class="col-sm-8">
                        <input class="form-control" type="text" name="fax" id="fax">
                    </div>
                </div>
            </div>
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-3 control-label">联系电话：</label>
                    <div class="col-sm-8">
                        <input class="form-control" type="text" name="phone" id="phone">
                    </div>
                </div>
            </div>
        </div>
        <div class="row">
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-3 control-label">邮政编码：</label>
                    <div class="col-sm-8">
                        <input class="form-control" type="text" name="postalCode" id="postalCode">
                    </div>
                </div>
            </div>
            <div class="col-sm-6">

                <div class="form-group">
                    <label class="col-sm-3 control-label">国家：</label>
                    <div class="col-sm-8">
                        <input class="form-control" type="text" name="country" id="country">
                    </div>
                </div>
            </div>
        </div>
        <div class="row">
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-3 control-label">城市：</label>
                    <div class="col-sm-8">
                        <input class="form-control" type="text" name="city" id="city">
                    </div>
                </div>
            </div>
            <div class="col-sm-6">

                <div class="form-group">
                    <label class="col-sm-3 control-label">联系人：</label>
                    <div class="col-sm-8">
                        <input class="form-control" type="text" name="contact" id="contact">
                    </div>
                </div>
            </div>
        </div>
        <div class="row">

            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-3 control-label">优先级：</label>
                    <div class="col-sm-8">
                        <input class="form-control" type="text" name="priority" id="priority">
                    </div>
                </div>
            </div>
            <div class="col-sm-6">

                <div class="form-group">
                    <label class="col-sm-3 control-label">信用：</label>
                    <div class="col-sm-8">
                        <input class="form-control" type="text" name="credit" id="credit">
                    </div>
                </div>
            </div>
        </div>
        <div class="row">
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-3 control-label is-required">状态：</label>
                    <div class="col-sm-8">
                        <select name="status" class="form-control m-b"
                                th:with="type=${@dict.getType('sys_normal_disable')}">
                            <option th:each="dict : ${type}" th:text="${dict.dictLabel}"
                                    th:value="${dict.dictValue}"></option>
                        </select>
                    </div>
                </div>
            </div>
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-3 control-label is-required">类型：</label>
                    <div class="col-sm-8">
                        <select id="type" name="type" class="form-control"
                                th:with="type=${@dict.getType('customer_type')}">
                            <option th:each="dict : ${type}" th:text="${dict.dictLabel}"
                                    th:value="${dict.dictValue}"></option>
                        </select>
                    </div>
                </div>
            </div>
        </div>
        <h4 class="form-header h4">其他信息</h4>
        <div class="row">
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-xs-3 control-label">备注：</label>
                    <div class="col-xs-8">
                        <textarea id="remark" name="remark" maxlength="500" class="form-control" rows="3"></textarea>
                    </div>
                </div>
            </div>
        </div>
    </form>
</div>
<div class="row">
    <div class="col-sm-offset-5 col-sm-10">
        <button type="button" class="btn btn-sm btn-primary" onclick="submitHandler()"><i class="fa fa-check"></i>保 存
        </button>&nbsp;
        <button type="button" class="btn btn-sm btn-danger" onclick="closeItem()"><i class="fa fa-reply-all"></i>关 闭
        </button>
    </div>
</div>
<th:block th:include="include :: footer"/>
<script type="text/javascript">
    var prefix = ctx + "system/customer";

    function submitHandler() {
        if ($.validate.form()) {
            $.operate.save(prefix + "/add", $('#form-customer-add').serialize());
        }
    }

</script>
</body>
</html>
